export interface stateType {
    token: string
}
const state: {
    actionsName: {
        [k: string]: string
    }
    state: stateType
    actions: {
        [k: string]: Function

    },
    asyncAction: {
        [k: string]: Function
    }
} = {
    actionsName: {},
    state: {
        token: ''
    },
    // 同步方法
    actions: {
        changeToken(newState: stateType, action: any){
            newState.token = action.token
        }
    },
    // 异步方法
    asyncAction: {

    }
}
let actionsName: { [k: string]: string } = {}
for (const key in state.actions) {
    actionsName[key] = key
}
state.actionsName = actionsName

export default state
